var mongoose=require('../mongoose_helper.js').mongoose
var TopicSchema = new mongoose.Schema({
	username: String,
	content:String,
	tab:String,
	title:String,
	insertTime:String
});
TopicSchema.statics.addTopic = function(topic, callback){
	this.create(topic, callback);
};
TopicSchema.statics.getTopics = function(query, option, callback){
	this.find(query, {}, option, callback);
};
TopicSchema.statics.getTopic = function(topicId,callback){
	this.findOne({_id:topicId},callback)
};
module.exports = mongoose.model('Topic', TopicSchema);